package com.dba.example.gwt.client.activities;

import javax.inject.Inject;

import com.dba.example.gwt.client.places.HomePlace;
import com.dba.example.gwt.client.views.HomeView;
import com.google.gwt.activity.shared.AbstractActivity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.place.shared.PlaceController;
import com.google.gwt.user.client.ui.AcceptsOneWidget;

public class HomeActivity extends AbstractActivity implements
		HomeView.Presenter {

	HomeView view;

	PlaceController pc;

	private HomePlace place;

	@Inject
	public HomeActivity(HomeView view, PlaceController pc) {
		this.view = view;
		this.pc = pc;
	}

	public void setPlace(HomePlace place) {
		this.place = place;
	}

	@Override
	public void start(AcceptsOneWidget containerWidget, EventBus eventBus) {
		view.setPresenter(this);
		containerWidget.setWidget(view.asWidget());

		view.displayToken(place.getToken());
	}

	public void onStop() {
	}

}
